package com.fjnu.teaching;

import lombok.Data;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @desc:
 * @author: Ping
 * @date: 2025/9/12 9:10
 *
 * @Service： 业务层
 *
 *
 */




@Service
public class TeachingService {
    Log log = LogFactory.getLog(TeachingService.class);
    /**
     * @Autowried :   automatically find a TeachingDao type bean and assemble it: ref. ;
     */

    @Autowired
    private TeachingDao teachingDao ;

    public TeachingService() {

    }
    public TeachingService(TeachingDao teachingDao) {
        this.teachingDao = teachingDao ;
    }

    public int startCourse(Teacher teacher, Course course){
        // control: new teacher and new course
        log.info("start a course");
        return teachingDao.insert(teacher,course) ;

    }

    /**
     * todo: invoke TeachingDao to delete teacher and course and add a test in tesecase.
     * @param teacher
     * @param course
     * @return
     */
    public int deleteTeaching(Teacher teacher, Course course) {

        return 0 ;
    }


}
